# 设计师插件模块 （仅用于开发使用）
cmake_minimum_required(VERSION 3.15)
project(cxi_designer)
include(../../cmake/utils.cmake)

config_project(ON)
add_library(${PROJECT_NAME} SHARED)

file(GLOB_RECURSE designer_src CONFIGURE_DEPENDS "*.cpp" "*.h" "*/*.cpp" "*/*.h")

target_include_directories(${PROJECT_NAME} PRIVATE ./)
target_sources(${PROJECT_NAME} PRIVATE ${designer_src})
target_link_libraries(${PROJECT_NAME} PRIVATE
        Qt5::Core
        Qt5::Widgets
        Qt5::Gui
        Qt5::Designer
        cxi_controls
)

if (CMAKE_BUILD_TYPE STREQUAL "Release")

    # 插件本体安装到 designer 下
    install(TARGETS ${PROJECT_NAME}
            RUNTIME DESTINATION designer       # Windows dll
            LIBRARY DESTINATION designer       # Linux .so / Mac dylib
            ARCHIVE DESTINATION designer       # 静态库 (一般不用)
    )

#    TODO:补充拷贝设计师插件依赖库的逻辑
endif ()

